package javabase.desginpattern.behavior.handlerchain;

/**
 * @author fance
 * @date 18-4-26 下午3:01
 */
public class Client {
    public static void main(String[] args) {
        Leader instructor = new Instructor("instructor");
        Leader departmentHead = new DepartmentHead("DepartmentHead");
        Leader president = new President("president");
        instructor.setSuccessor(departmentHead);
        departmentHead.setSuccessor(president);

        LeaveNode leaveNode1 = new LeaveNode( 3,"1");
        LeaveNode leaveNode2 = new LeaveNode( 7,"2");
        LeaveNode leaveNode3 = new LeaveNode( 15,"3");
        instructor.handleRequest(leaveNode1);
        instructor.handleRequest(leaveNode2);
        instructor.handleRequest(leaveNode1);
    }
}
